<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #box {
            width: 100px;
            height: 100px;
            background-color: antiquewhite;

        }
    </style>
</head>

<body>
    <div id="box">

    </div>
    <script src="https://cdn.jsdelivr.net/npm/gsap@3.11/dist/gsap.min.js"></script>

    <script>
        // https://zhuanlan.zhihu.com/p/643893714?utm_id=0
        // https://blog.csdn.net/changbb/article/details/131675810

        // 引入以后 提供了一个全局变量
        // gsap 
        console.log(gsap);

        // 通过 css 选择器来确定执行动画的元素

        // 第二个参数 ---做动画的属性
        gsap.to('#box', {
            x: 400, // 移动位置
            y: 50,
            rotation: 180, // 旋转角度
            duration: 3, // 持续时间
            repeat: 2 // 重复次数
        });
    </script>

    <!-- Element to contain animated typing -->
    <span id="element"></span>

    <!-- Load library from the CDN -->
    <script src="https://unpkg.com/typed.js@2.0.16/dist/typed.umd.js"></script>

    <!-- Setup and start animation! -->
    <script>
        var typed = new Typed('#element', {
            strings: ['This is a JavaScript library', 'This is an ES6 module'],
            typeSpeed: 50,//毫秒
        });
    </script>

</body>

</html>